<template>
  <input type="text" v-model="str">
  <div>原字符串：{{ str }}</div>
  <div>翻转字符串：{{ reverseStr }}</div>
</template>

<script setup>
    import { ref, computed } from 'vue'
    const str = ref('today is a sunny day');
    const reverseStr = computed(() => {
        return str.value.split('').reverse().join(''); 
    })
</script>